package guda.house.biz.util;

import org.springframework.util.StringUtils;

/**
 * Created by well on 16/5/29.
 */
public class StringUtil {

    public static String cut(String str, Integer len) {
        if (!StringUtils.hasText(str)) {
            return str;
        }
        if (len == null) {
            return str;
        }
        if (len < str.length()) {
            return str.substring(0, len);
        }
        return str;
    }

    public static String filterNull(Object str) {
        if(str == null){
            return "";
        }
        return str.toString();
    }
}
